package VN.EDU.IMIC.DEVELOPER.TRANTHITHANHNGA.EXAM01.TASK1;

public class Trapezium_Controllers implements IGeometricObject {

	private Trapezium_Entity Obj;

	public Trapezium_Controllers(Trapezium_Entity obj) {
		Obj = obj;
	}

	@Override
	public double getArea(Object iObj) {
		Trapezium_Entity Obj =(Trapezium_Entity) iObj;
		return ((Obj.getBigside()+Obj.getSmallside())*Obj.getHeight())/2 ;
	}

	@Override
	public double getPerimeter(Object iObj) {
		Trapezium_Entity Obj = (Trapezium_Entity) iObj;
		return Obj.getBigside() + Obj.getSmallside() + Obj.getSide1()
				+ Obj.getSide2();
	}

}
